// ...........................................................................................................
// (C) Copyright  1996/2008 Fuego Inc.  All Rights Reserved
// THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF Fuego Inc.
// The copyright notice above does not evidence any actual or intended
// publication of such source code.
//
// Last changed on 2008-01-31 14:19:06 (-0300), by: pcolunga. $Revision$
// ...........................................................................................................

package com.webcamtracker.tracker.example.spatial;

import com.webcamtracker.move.tracking.AplicationListener;
import com.webcamtracker.move.tracking.TrackingEventDispacher;
import com.webcamtracker.move.tracking.TrackingEventType;

import javax.swing.*;

public class SpatialFrame extends JFrame implements AplicationListener {
    //~ Methods ..............................................................................................

    private SpatialPanel portalPanel;

    public SpatialFrame() {
        super("Spacial Frame!");
        start();
    }

    public static void main(String[] args) {
        JFrame frame = new JFrame("Spatial Webcam Tracker");
        frame.setContentPane(new SpatialPanel());
        frame.pack();
        frame.setVisible(true);
    }

    public void start() {

        portalPanel = new SpatialPanel();

        setContentPane(portalPanel);
        pack();
        setVisible(true);
    }

    public void subscribeToTracking(TrackingEventDispacher dispacher, String elementId) {
        System.out.println("SpatialFrame.subscribeToTracking");
        dispacher.addTrackingEventListener(portalPanel.getSpatial(), TrackingEventType.ALL);
    }
}
